package ModelLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class DVDTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class DVDTest
{
    private ModelLayer.DVD dVD1;

    /**
     * Default constructor for test class DVDTest
     */
    public DVDTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        dVD1 = new ModelLayer.DVD(1, "1", "1", "1");
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void test1AllMethods()
    {
        assertSame("1", dVD1.getArtist());
        java.util.ArrayList<ModelLayer.Copy> arrayLis1 = dVD1.getCopyList();
        assertEquals(arrayLis1, arrayLis1);
        assertEquals("1", dVD1.getDate());
        assertEquals(1, dVD1.getId());
        assertSame("1", dVD1.getTitle());
    }

    @Test
    public void testaddCopy()
    {
        ModelLayer.Copy copy1 = new ModelLayer.Copy(1, "1", 1);
        assertEquals(false, dVD1.addCopy(copy1));
    }

    @Test
    public void test1CopyMethods()
    {
        ModelLayer.Copy copy1 = new ModelLayer.Copy(1, "1", 1);
        assertEquals(false, dVD1.addCopy(copy1));
        assertEquals(copy1, dVD1.getCopy(1));
        java.util.ArrayList<ModelLayer.Copy> arrayLis1 = dVD1.getCopyList();
        assertSame(arrayLis1, arrayLis1);
    }

    @Test
    public void testManyCopyMethods()
    {
        ModelLayer.Copy copy1 = new ModelLayer.Copy(1, "1", 1);
        ModelLayer.Copy copy2 = new ModelLayer.Copy(2, "2", 2);
        assertEquals(false, dVD1.addCopy(copy1));
        assertEquals(true, dVD1.addCopy(copy1));
        assertEquals(false, dVD1.addCopy(copy2));
        assertSame(copy2, dVD1.getCopy(2));
        java.util.ArrayList<ModelLayer.Copy> arrayLis1 = dVD1.getCopyList();
        assertSame(arrayLis1, arrayLis1);
    }
}




